﻿using MediatR;
using T.Personnel.API.Application.Command.RegisterCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.API.Application.CommandHandler.RegisterHandler
{
    public class UpdRegisterHandler : IRequestHandler<UpdRegisterCommand, int>
    {
        private readonly IRegisterRepository registerRepository;

        public UpdRegisterHandler(IRegisterRepository registerRepository)
        {
            this.registerRepository = registerRepository;
        }

        public async Task<int> Handle(UpdRegisterCommand request, CancellationToken cancellationToken)
        {
            return await registerRepository.UpdRegisterAsync(request);
        }
    }
}
